from urllib import request
from urllib import parse

url = f"http://httpbin.org/post?"
headers = {
    "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36",
}
date_bytes = parse.urlencode({
    "name":"奇酷教育",
    "address":"东三街"
}).encode()

# 构建请求对象
req = request.Request(url,data=date_bytes,method='POST',headers=headers)
print(req.full_url)
print(req.method)
print(req.headers)

# 发起请求
res = request.urlopen(req)
print(res.read().decode())